import requests
a ={
  "主题首页": {
    "method": "get",
    "url": "http://49.233.108.117:3000/api/v1/topics",
    "data": {
      "page":1,
      "tab":"ask",
      "limit":1,
      "mdrender":"false"
    }
  },
  "发布话题": {
    "method": "post",
    "url": "http://49.233.108.117:3000/api/v1/topics",
    "data": {
      "accesstoken":"32f50cd9-f670-48a0-9df6-e614f3a149d4",
      "title":"helloworld",
      "tab":"ask",
      "content":"xxxxxxxxxxxxxxxxx"
    }
  }
}

for i in a:
    if a[i]['method'] == 'get':
        r = requests.get(url=a[i]['url'],params=a[i]['data'])
        print(r.status_code)
        print(r.json())

    elif a[i]['method'] == 'post':
        r = requests.post(url=a[i]['url'],data=a[i]['data'])
        print(r.status_code)
        print(r.json())